home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / mus / misc / Lame68k.lha / USAGE < prev   
Text File  |  2000-09-17  |  23KB  |  696 lines

  1.  
  2. % lame [options] inputfile [outputfile]
  3.  
  4. =======================================================================
  5. Examples:
  6. =======================================================================
  7. fixed bit rate jstereo 128 kbps encoding:
  8. % lame sample.wav  sample.mp3      
  9.  
  10. fixed bit rate jstereo 128 kbps encoding, highest quality:  (recommended)
  11. % lame -h sample.wav  sample.mp3      
  12.  
  13. To disable joint stereo encoding (slightly faster, but less quality at 
  14. bitrates <= 128 kbps)
  15. % lame -m s sample.wav  sample.mp3     
  16.  
  17. Fast encode, low quality  (no noise shaping)
  18. % lame -f sample.wav  sample.mp3     
  19.  
  20. Variable Bitrate (VBR): (use -V n to adjust quality/filesize)
  21. % lame -h -v sample.wav sample.mp3
  22.  
  23. Note: VBR is currently under heavy development.  Right now it can
  24. often result in too much compression.  I would recommend using VBR
  25. with a minimum bitrate of 112 kbps.  This will let LAME increase
  26. the bitrate for difficult-to-encode frames, but prevent LAME from
  27. being too aggressive for simple frames:
  28.  
  29. % lame -h -v -b 112  sample.wav sample.mp3
  30.  
  31.  
  32. =======================================================================
  33. LOW BITRATES
  34. =======================================================================
  35. At lower bitrates, (like 24 kbps per channel), it is recommended that
  36. you use a 16 kHz sampling rate combined with lowpass filtering.  LAME,
  37. as well as commercial encoders (FhG, Xing) will do this automatically.
  38. However, if you feel there is too much (or not enough) lowpass
  39. filtering, you may need to try different values of the lowpass cutoff
  40. and passband width (--resample, --lowpass and --lowpass-width options).
  41.  
  42.  
  43. =======================================================================
  44. STREAMING EXAMPLES
  45. =======================================================================
  46.  
  47. % cat inputfile | lame [options] - - > output
  48.  
  49.  
  50.  
  51.  
  52. =======================================================================
  53.  
  54. For more options, just type:
  55. % lame --help
  56.  
  57. Scripts are included to run lame on multiple files:
  58.  
  59. bach script:  mlame     Run "mlame -?" for instructions.
  60. sh script:    auenc     Run auenc for instructions
  61.  
  62.  
  63.  
  64. =======================================================================
  65. options guide:
  66. =======================================================================
  67. These options are explained in detail below.
  68.  
  69.  
  70. Quality related:
  71.  
  72. -m m/s/j/f     mode selection
  73. -k             disable all filtering
  74. -d             allow block types to differ between channels
  75. --athonly      ignore psy-model output, only use masking from the ATH
  76. --voice        experimental voice encoding mode
  77. --noshort      disable short blocks
  78.  
  79.  
  80. Constant Bit Rate (CBR)
  81. -b  n          set bitrate (8, 16, 24, ..., 320)
  82. -h             higher quality but slower
  83. -f             disable noise shaping.  Encodes faster, but lower quality
  84. --freeformat   produce a free format bitstream.  User must also specify
  85.                a bitrate with -b, between 8 and 320 kbps.
  86.  
  87. Variable Bit Rate (VBR)
  88. -v             VBR
  89. --vbr-old      use old variable bitrate (VBR) routine (default)
  90. --vbr-new      use new variable bitrate (VBR) routine
  91. -V n           VBR quality setting  (0=highest quality, 9=lowest)
  92. -b  n          specify a minimum allowed bitrate (8,16,24,...,320)
  93. -B  n          specify a maximum allowed bitrate (8,16,24,...,320)
  94. -F             strictly enforce minimum bitrate
  95. -t             disable Xing VBR informational tag 
  96. --nohist       disable display of VBR bitrate histogram
  97.  
  98. --abr n        specify average bitrate desired
  99.  
  100.  
  101. Experimental (undocumented):  may work better or worse:
  102.  
  103. -X n           try different quality measures (when comparing quantizations)
  104. -Y             
  105. -Z             
  106.  
  107.  
  108. Operational:
  109.  
  110. -r             assume input file is raw PCM
  111. -s  n          input sampling frequency in kHz (for raw PCM input files)
  112. --resample n   output sampling frequency
  113. --mp3input     input file is an MP3 file.  decode using mpglib/mpg123
  114. --ogginput     input file is an Ogg Vorbis file.  decode using libvorbis
  115. -x             swap bytes of input file
  116. --scale <arg>  multiply PCM input by <arg>
  117. -a             downmix stereo input file to mono .mp3
  118. -e  n/5/c      de-emphasis
  119. -p             add CRC error protection
  120. -c             mark the encoded file as copyrighted
  121. -o             mark the encoded file as a copy
  122. -S             don't print progress report, VBR histogram
  123. -g             run MP3x, the graphical frame analyzer
  124. --strictly-enforce-ISO   comply as much as possible to ISO MPEG spec
  125.  
  126. --decode       assume input file is an mp3 file, and decode to wav.
  127. -t             disable writing of WAV header when using --decode
  128.                (decode to raw pcm, native endian format (use -x to swap))
  129.  
  130. --ogg          Encode using Ogg Vorbis (.ogg) instead of mp3.
  131.  
  132.  
  133.  
  134. ID3 tagging:
  135.  
  136. --tt <title>    audio/song title (max 30 chars for version 1 tag)
  137. --ta <artist>   audio/song artist (max 30 chars for version 1 tag)
  138. --tl <album>    audio/song album (max 30 chars for version 1 tag)
  139. --ty <year>     audio/song year of issue (1 to 9999)
  140. --tc <comment>  user-defined text (max 30 chars for v1 tag, 28 for v1.1)
  141. --tn <track>    audio/song track number (1 to 99, creates v1.1 tag)
  142. --tg <genre>    audio/song genre (name or number in list)
  143. --add-id3v2     force addition of version 2 tag
  144. --id3v1-only    add only a version 1 tag
  145. --id3v2-only    add only a version 2 tag
  146. --space-id3v1   pad version 1 tag with spaces instead of nulls
  147. --pad-id3v2     pad version 2 tag with extra 128 bytes
  148. --genre-list    print alphabetically sorted ID3 genre list and exit
  149.  
  150. Note: A version 2 tag will NOT be added unless one of the input fields
  151. won't fit in a version 1 tag (e.g. the title string is longer than 30
  152. characters), or the `--add-id3v2' or `--id3v2-only' options are used,
  153. or output is redirected to stdout.
  154.  
  155.  
  156.  
  157. options not yet described:
  158. --nores            disable bit reservoir
  159. --noath            disable ATH
  160. --athlower <n db>  lower the ATH by n db.  
  161. --athshort         use only the ATH for short blocks
  162. --cwlimit <freq>   specify range of tonality calculation
  163. --disptime
  164.  
  165. --lowpass
  166. --lowpass-width
  167. --highpass
  168. --highpass-width
  169.  
  170.  
  171.  
  172.  
  173.  
  174. =======================================================================
  175. Detailed description of all options in alphabetical order
  176. =======================================================================
  177.  
  178.  
  179. =======================================================================
  180. downmix
  181. =======================================================================
  182. -a  
  183.  
  184. mix the stereo input file to mono and encode as mono.  
  185.  
  186. This option is only needed in the case of raw PCM stereo input 
  187. (because LAME cannot determine the number of channels in the input file).
  188. To encode a stereo PCM input file as mono, use "lame -m s -a"
  189.  
  190. For WAV and AIFF input files, using "-m m" will always produce a
  191. mono .mp3 file from both mono and stereo input.
  192.  
  193.  
  194. =======================================================================
  195. average bitrate encoding (aka Safe VBR)
  196. =======================================================================
  197. --abr n
  198.  
  199. turns on encoding with a targeted average bitrate of n kbps, allowing
  200. to use frames of different sizes.  The allowed range of n is 8...320 
  201. kbps, you can use any integer value within that range.
  202.  
  203. It can be combined with the -b and -B switches like
  204. lame --abr 123 -b 64 -B 192 a.wav a.mp3
  205. which would limit the allowed frame sizes between 64 and 192 kbps.
  206.  
  207. Using -B is NOT RECOMMENDED.  A 128 kbps CBR bitstream, because of the
  208. bit reservoir, can actually have frames which use as many bits as a
  209. 320 kbps frame.  VBR modes minimize the use of the bit reservoir, and
  210. thus need to allow 320 kbps frames to get the same flexability as CBR
  211. streams.
  212.  
  213.  
  214.  
  215.  
  216. =======================================================================
  217. ATH only
  218. =======================================================================
  219. --athonly
  220.  
  221. This option causes LAME to ignore the output of the psy-model and
  222. only use masking from the ATH.  Might be useful at very high bitrates
  223. or for testing the ATH.  
  224.  
  225.  
  226.  
  227.  
  228. =======================================================================
  229. bitrate
  230. =======================================================================
  231. -b  n
  232.  
  233. For MPEG-1 (sampling frequencies of 32, 44.1 and 48 kHz)
  234. n =   32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320
  235.  
  236. For MPEG-2 and MPEG-2.5 (sampling frequencies of 8, 11.025, 
  237. 12, 16, 22.05 and 24 kHz)
  238. n = 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160
  239.  
  240.  
  241. The bitrate to be used.  Default is 128 kbps MPEG1, 80 kbps MPEG2.
  242.  
  243. When used with variable bitrate encodings (VBR), -b specifies the
  244. minimum bitrate to use.  This is useful to prevent LAME VBR from
  245. using some very aggressive compression which can cause some distortion
  246. due to small flaws in the psycho-acoustic model.
  247.  
  248. =======================================================================
  249. max bitrate
  250. =======================================================================
  251. -B  n
  252.  
  253. see also option "-b" for allowed bitrates.
  254.  
  255. Maximum allowed bitrate when using VBR.
  256.  
  257.  
  258. =======================================================================
  259. copyright
  260. =======================================================================
  261. -c   
  262.  
  263. mark the encoded file as copyrighted
  264.  
  265.  
  266.  
  267. =======================================================================
  268. block type control
  269. =======================================================================
  270. -d 
  271.  
  272. Allows the left and right channels to use different block types.
  273. Normally this is not allowed, only because the FhG encoder does
  274. not seem to allow it either.  If anyone finds a sample where -d
  275. produces better results, let me know.  (mt@sulaco.org)
  276.  
  277.  
  278. =======================================================================
  279. mpglib decode capability
  280. =======================================================================
  281. --decode 
  282.  
  283. This just uses LAME's mpg123/mpglib interface to decode an MP3 file to
  284. a wav file.  The input file can be any input type supported by
  285. encoding, including .mp3 (layers 1, 2 and 3) and .ogg.  
  286.  
  287. If -t is used (disable wav header), LAME will output
  288. raw pcm in native endian format (use -x to swap bytes).
  289.  
  290.  
  291. =======================================================================
  292. de-emphasis
  293. =======================================================================
  294. -e  n/5/c   
  295.  
  296.   n = (none, default)
  297.   5 = 0/15 microseconds
  298.   c = citt j.17
  299.  
  300. All this does is set a flag in the bitstream.  If you have a PCM
  301. input file where one of the above types of (obsolete) emphasis has
  302. been applied, you can set this flag in LAME.  Then the mp3 decoder
  303. should de-emphasize the output during playback, although most 
  304. decoders ignore this flag.
  305.  
  306. A better solution would be to apply the de-emphasis with a standalone
  307. utility before encoding, and then encode without -e.  
  308.  
  309.  
  310.  
  311. =======================================================================
  312. fast mode
  313. =======================================================================
  314. -f   
  315.  
  316. disable noise shaping.  Encodes faster, but lower quality.
  317. Psycho acoustics are computed for bit allocation and 
  318. pre-echo detection.
  319.  
  320. =======================================================================
  321. strictly enforce VBR minimum bitrate
  322. =======================================================================
  323. -F   
  324.  
  325. strictly enforce VBR minimum bitrate.  With out this optioni, the minimum
  326. bitrate will be ignored for passages of analog silence.
  327.  
  328.  
  329.  
  330. =======================================================================
  331. free format bitstreams
  332. =======================================================================
  333. --freeformat   
  334.  
  335. LAME will produce a fixed bitrate, free format bitstream.
  336. User must specify the desired bitrate in kbps, which can
  337. be any integer between 8 and 320.
  338.  
  339. Not supported by most decoders.  Decoders only required to support
  340. up to 320 kbps.  
  341.  
  342. Decoders which can handle free format:
  343.                      supports up to
  344. "lame --decode"          550 kbps  
  345. Freeamp:                 440 kbps
  346. l3dec:                   310 kbps
  347.  
  348.  
  349.  
  350.  
  351.  
  352. =======================================================================
  353. graphical frame analyzer
  354. =======================================================================
  355. -g
  356.  
  357. run MP3x, the graphical frame analyzer analysis on the inputfile.  The
  358. inputfile can be either an .mp3 file or uncompressed audio file.  MP3x
  359. support must be compiled into LAME, and requires GTK 1.2.
  360. Documentation (outdated) is under the About pull down menu.
  361.  
  362.  
  363.  
  364. =======================================================================
  365. high quality
  366. =======================================================================
  367. -h
  368.  
  369. use (maybe) some quality improvements
  370.  
  371. LAME 3.21 and up:  -h enables specialized mid/side masking thresholds to
  372. be used in jstereo mode.  Will sound better in jstereo mode
  373. but is 20% slower.  No effect for mono files.
  374.  
  375. LAME 3.58beta and up: -h also enables a more accurate but slightly
  376. slower quantization formula.  
  377.  
  378.  
  379.  
  380. =======================================================================
  381. keep all frequencies
  382. =======================================================================
  383. -k   
  384.  
  385. keep all frequencies.  (Disable all filters)
  386.  
  387. LAME will automatically apply various types of lowpass filters.  This
  388. is because the high frequency coefficients can take up a lot of bits
  389. that would be better used for lower, more important frequencies.
  390.  
  391. -k will disable all lowpass filtering.  Not recommended.
  392.  
  393.  
  394.  
  395. =======================================================================
  396. Modes:
  397. =======================================================================
  398.  
  399. -m m           mono
  400. -m s           stereo
  401. -m j           joint stereo
  402. -m f           forced mid/side stereo
  403. -m d           dual (independent) channels
  404. -m i           intensity stereo
  405.  
  406. MONO is the default mode for mono input files.  If "-m m" is specified
  407. for a stereo input file, the two channels will be averaged into a mono
  408. signal.  
  409.  
  410. STEREO
  411.  
  412. JOINT STEREO is the default mode for stereo files with fixed bitrates of
  413. 128 kbps or less.  At higher fixed bitrates, the default is stereo.
  414. For VBR encoding, jstereo is the default for VBR_q >4, and stereo
  415. is the default for VBR_q <=4.  You can override all of these defaults
  416. by specifing the mode on the command line.  
  417.  
  418. jstereo means the encoder can use (on a frame by frame bases) either
  419. regular stereo (just encode left and right channels independently)
  420. or mid/side stereo.  In mid/side stereo, the mid (L+R) and side (L-R)
  421. channels are encoded, and more bits are allocated to the mid channel
  422. than the side channel.  This will effectively increase the bandwidth
  423. if the signal does not have too much stereo separation.  
  424.  
  425. Mid/side stereo is basically a trick to increase bandwidth.  At 128 kbps,
  426. it is clearly worth while.  At higher bitrates it is less useful.
  427.  
  428. Using mid/side stereo inappropriately can result in audible
  429. compression artifacts.  To much switching between mid/side and regular
  430. stereo can also sound bad.  To determine when to switch to mid/side
  431. stereo, LAME uses a much more sophisticated algorithm than that
  432. described in the ISO documentation.
  433.  
  434. FORCED MID/SIDE STEREO forces all frames to be encoded mid/side stereo.  It 
  435. should only be used if you are sure every frame of the input file
  436. has very little stereo seperation.  
  437.  
  438. DUAL CHANNELS
  439.  
  440. INTENSITY STEREO
  441.  
  442.  
  443. =======================================================================
  444. MP3 input file
  445. =======================================================================
  446. --mp3input
  447.  
  448. Assume the input file is a MP3 file.  Usefull for downsampling from
  449. one mp3 to another.  If the filename ends in ".mp3" LAME will assume
  450. it is an MP3.  For stdin or MP3 files which dont end in .mp3 you need
  451. to use this switch.
  452.  
  453.  
  454. =======================================================================
  455. disable historgram display
  456. =======================================================================
  457. --nohist
  458.  
  459. By default, LAME will display a bitrate histogram while producing
  460. VBR mp3 files.  This will disable that feature.
  461.  
  462.  
  463. =======================================================================
  464. disable short blocks
  465. =======================================================================
  466. --noshort
  467.  
  468. Encode all frames using long blocks.
  469.  
  470.  
  471.  
  472. =======================================================================
  473. non-original
  474. =======================================================================
  475. -o   
  476.  
  477. mark the encoded file as a copy
  478.  
  479.  
  480.  
  481. =======================================================================
  482. Ogg Vorbis encoding
  483. =======================================================================
  484. --ogg
  485.  
  486. Encode using the Ogg Vobis codec (using libvorbis) instead of
  487. LAME's internal mp3 codec.
  488.  
  489. Most options related to the internal workings of the MP3 format
  490. are ignored when using "--ogg".  But downsampling and stereo/mono
  491. options work.  
  492.  
  493. Currently (8/00) Ogg Vorbis only supports 5 modes, which range
  494. from approximately 128 kbps to 320 kbps.   Based on the bitrate
  495. specified (or the -V n option), LAME will take its best guess
  496. as to which of the 5 Vorbis modes will give about close to the
  497. desired bitrate.
  498.  
  499.  
  500.  
  501.  
  502. =======================================================================
  503. Ogg Vorbis input file
  504. =======================================================================
  505. --ogginput
  506.  
  507. Assume the input file is an Ogg Vorbis file.  Mostly usefull
  508. with --decode for playing back .ogg files, or converting
  509. your .ogg collection to MP3 :-)
  510.  
  511. If the filename ends in ".ogg" LAME will assume it is Ogg.  For
  512. stdin or files which dont end in .ogg you need to use this switch.
  513.  
  514.  
  515.  
  516.  
  517. =======================================================================
  518. CRC error protection
  519. =======================================================================
  520. -p  
  521.  
  522. turn on CRC error protection.  
  523. Yes this really does work correctly in LAME.  However, it takes 
  524. 16 bits per frame that would otherwise be used for encoding.
  525.  
  526.  
  527.  
  528. =======================================================================
  529. input file is raw pcm
  530. =======================================================================
  531. -r  
  532.  
  533. Assume the input file is raw pcm.  Sampling rate and mono/stereo/jstereo
  534. must be specified on the command line.  Without -r, LAME will perform
  535. several fseek()'s on the input file looking for WAV and AIFF headers.
  536.  
  537. Not supported if LAME is compiled to use LIBSNDFILE.
  538.  
  539.  
  540.  
  541. =======================================================================
  542. output sampling frequency in kHz
  543. =======================================================================
  544. --resample  n
  545.  
  546. where n = 8, 11.025, 12, 16, 22.05, 24, 32, 44.1, 48
  547.  
  548. Output sampling frequency.  Resample the input if necessary.  
  549.  
  550. If not specified, LAME may sometimes resample automatically 
  551. when faced with extreme compression conditions (like encoding
  552. a 44.1 kHz input file at 32 kbps).
  553.  
  554.  
  555.  
  556. =======================================================================
  557. sampling frequency in kHz
  558. =======================================================================
  559. -s  n
  560.  
  561. where n = sampling rate in kHz.
  562.  
  563. Required for raw PCM input files.  Otherwise it will be determined
  564. from the header information in the input file.
  565.  
  566. LAME will automatically resample the input file to one of the
  567. supported MP3 samplerates if necessary.
  568.  
  569.  
  570. =======================================================================
  571. silent operation
  572. =======================================================================
  573. -S
  574.  
  575. don't print progress report
  576.  
  577. =======================================================================
  578. scale
  579. =======================================================================
  580. --scale <arg>
  581.  
  582. Scales input by <arg>.  This just multiplies the PCM data
  583. (after it has been converted to floating point) by <arg>.  
  584.  
  585. <arg> > 1:  increase volume
  586. <arg> = 1:  no effect
  587. <arg> < 1:  reduce volume
  588.  
  589. Use with care, since most MP3 decoders will truncate data
  590. which decodes to values greater than 32768.  
  591.  
  592.  
  593. =======================================================================
  594. strict ISO complience
  595. =======================================================================
  596. --strictly-enforce-ISO   
  597.  
  598. With this option, LAME will enforce the 7680 bit limitation on
  599. total frame size.  This results in many wasted bits for
  600. high bitrate encodings.
  601.  
  602.  
  603. =======================================================================
  604. disable Xing VBR tag
  605. =======================================================================
  606. -t              
  607.  
  608. Disable writing of the Xing VBR Tag (only valid if -v flag is
  609. specified) This tag in embedded in frame 0 of the MP3 file.  It lets
  610. VBR aware players correctly seek and compute playing times of VBR
  611. files.
  612.  
  613. When '--decode' is specified (decode mp3 to wav), this flag will 
  614. disable writing the WAV header.  The output will be raw pcm,
  615. native endian format.  Use -x to swap bytes.
  616.  
  617.  
  618.  
  619. =======================================================================
  620. variable bit rate  (VBR)
  621. =======================================================================
  622. -v
  623.  
  624. Turn on VBR.  There are several ways you can use VBR.  I personally
  625. like using VBR to get files slightly bigger than 128 kbps files, where
  626. the extra bits are used for the occasional difficult-to-encode frame.
  627. For this, try specifying a minimum bitrate to use with VBR:
  628.  
  629. lame -v      -b 112  input.wav output.mp3
  630.  
  631. If the file is too big, use -V n, where n = 0...9
  632.  
  633. lame -v -V n -b 112  input.wav output.mp3
  634.  
  635.  
  636. If you want to use VBR to get the maximum compression possible,
  637. and for this, you can try:  
  638.  
  639. lame -v  input.wav output.mp3
  640. lame -v -V n input.wav output.mp3         (to vary quality/filesize)
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647. =======================================================================
  648. VBR quality setting
  649. =======================================================================
  650. -V n       
  651.  
  652. n = 0...9.  Specifies the value of VBR_q.
  653. default = 4,  highest quality = 0, smallest files = 9
  654.  
  655.  
  656.  
  657. How is VBR_q used?
  658.  
  659. The value of VBR_q influences two basic parameters of LAME's psycho
  660. acoustics:
  661.  a) the absolute threshold of hearing
  662.  b) the sample to noise ratio
  663. The lower the VBR_q value the lower the injected quantization noise
  664. will be.
  665.  
  666. *NOTE* No psy-model is perfect, so there can often be distortion which
  667. is audible even though the psy-model claims it is not!  Thus using a
  668. small minimum bitrate can result in some aggressive compression and
  669. audible distortion even with -V 0.  Thus using -V 0 does not sound
  670. better than a fixed 256 kbps encoding.  For example: suppose in the 1 kHz
  671. frequency band the psy-model claims 20 dB of distortion will not be
  672. detectable by the human ear, so LAME VBR-0 will compress that
  673. frequency band as much as possible and introduce at most 20 dB of
  674. distortion.  Using a fixed 256 kbps framesize, LAME could end up
  675. introducing only 2 dB of distortion.  If the psy-model was correct,
  676. they will both sound the same.  If the psy-model was wrong, the VBR-0
  677. result can sound worse.
  678.  
  679.  
  680. =======================================================================
  681. voice encoding mode
  682. =======================================================================
  683. --voice
  684.  
  685. An experimental voice encoding mode.  Tuned for 44.1 kHz input files.
  686.  
  687.  
  688. =======================================================================
  689. swapbytes   
  690. =======================================================================
  691. -x
  692.  
  693. swap bytes in the input file (and output file when using --decode).
  694. For sorting out little endian/big endian type problems.  If your
  695. encodings sound like static, try this first.
  696.